package useFn;

public class demo2 {
    public static void main(String[] args) {
        myThread2 thread1 = new myThread2();
        myThread2 thread2 = new myThread2();
        Thread thread111 = new Thread(thread1);
        Thread thread222 = new Thread(thread2);
        System.out.println(thread111.getName());
        System.out.println(thread222.getName());
        System.out.println(Thread.currentThread().getName()); // main方法的 线程 叫 main
    }
}

class myThread2 implements   Runnable{

    @Override
    public void run() {
        Thread thread = Thread.currentThread(); // thread-0 -1
        System.out.println(thread.getName());
    }
}